<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  function Parent(msg){
    this.msg = msg;
  }
  Parent.prototype.show = function(){
    console.log(this.msg);
  }

  function Child(){}
  Child.prototype = new Parent("world");
  Child.prototype.show = function(){
    console.log("child的show")
  }
  // Child.prototype.__proto__.show = function(){
  //   console.log("child的show")
  // }


  const p = new Parent("hello");
  console.log(p);
  p.show();
  
  const c = new Child();
  console.log(c);
  c.show();

  // c => c.__proto__ => Child.prototype => Parent的实例 => Parent的实例.__proyo__ => Parent.prototype


  
</script>
</html>